home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / Tools / Cheat Sheet < prev    next >
Text File  |  1991-05-01  |  1KB  |  88 lines

  1. Failure Handler code:
  2.  
  3.     FailInfo        fi;
  4.  
  5.     if (!fi.CatchFailure())
  6.     {
  7.         ...Code to test.
  8.         fi.Success();
  9.     }
  10.     else
  11.     {    //    Failure Handler.
  12.         ...The failure handler code.
  13.         fi.ReSignal();                    // Optional. Omit to continue.
  14.     }
  15.  
  16.  
  17.  
  18. Nested Procedure class:
  19.  
  20. typedef pascal void (*DoToObject) (TObject* theView, void*  staticLink);
  21.  
  22. class CProcName {
  23.     // Fields
  24.     
  25.     VPoint&            aVPoint;
  26.     const VRect&    aVRect;
  27.  
  28. public:
  29.  
  30.     // Constructor
  31.     
  32.     CProcName(VPoint&    theVPoint, const VRect&    theVRect): 
  33.         aVPoint (theVPoint), aVRect (theVRect) {}
  34.     
  35.     // Method
  36.     
  37.     pascal void CProcName::DoProcName(TObject* theObject);
  38. };
  39.  
  40. pascal void CProcName::DoProcName(TObject* theObject)
  41. {
  42.         ... Local Vars
  43.         
  44.         ... Code
  45. }
  46.  
  47.  
  48. Switch statement sytax.
  49.  
  50. switch (putz) 
  51. {
  52.     case chPageUp:
  53.     case chPageDown:
  54.         ... Do stuff
  55.         break;
  56.     default:
  57.         inherited::DoKeyCommand(event);
  58. }    
  59.  
  60. Set operators:
  61.  
  62. if (adnLineTop IN newAdornment)
  63.  
  64.     becomes:
  65.  
  66. if __IsSetBit__ (newAdornment,adnLineTop)
  67.  
  68. Usefull for WITH statements:
  69.  
  70. ControlTemplate&    templateData = (ControlTemplate&) *itsParams;
  71.  
  72. Conversions:
  73.  
  74. Pascal                    C++
  75.  
  76. CHR                        (unsigned char)
  77. EXIT                    return
  78. LEAVE                    break;
  79. BXOR                    ^
  80. Member(item, TObject)    item->IsMemberClass(GetClassIDFromName("TObject"))
  81.  
  82.  
  83. Member statement:
  84.  
  85.     if (event->IsMemberClass(GetClassIDFromName("TTracker")))
  86.         ;
  87.     
  88.